#!/bin/bash

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/../..

ln -fs $ROOT_DIR/project/config/production/nginx/coin_analysis.conf /etc/nginx/sites-enabled/coin_analysis
/usr/sbin/service nginx reload

/bin/bash $ROOT_DIR/project/tool/dep_build.sh link
/usr/bin/php $ROOT_DIR/public/cli.php migrate:install
/usr/bin/php $ROOT_DIR/public/cli.php migrate
/usr/bin/php $ROOT_DIR/public/cli.php portal:permission-regist

ln -fs $ROOT_DIR/project/config/production/supervisor/queue_worker.conf /etc/supervisor/conf.d/queue_worker.conf
/usr/bin/supervisorctl update
/usr/bin/supervisorctl restart queue_worker:*
